package com.zzy.ecommerce.dao;

import com.zzy.ecommerce.domain.TGoods;

import java.util.List;

import com.zzy.ecommerce.domain.TUser;
import org.apache.ibatis.annotations.*;

@Mapper
public interface TGoodsMapper {
    @Select("select * from t_goods")
    List<TGoods> selectAllGoods();

    @Delete("delete from t_goods where id=#{id}")
    Integer deleteOneGoods(Integer id);

    @Insert("insert into t_goods(goodsId,goodsName,goodsPrice,goodsStock) values(#{goodsid},#{goodsname},#{goodsprice},#{goodsstock})")
    Integer insertOneGoods(TGoods tGoods);

    @Delete("delete from t_goods")
    Integer deleteAllGoods();

    @Update("update t_goods set goodsStock=#{goodsStock} where goodsId=#{id}")
    Integer updateOneGoodsStock(Integer id,Integer goodsStock);

    @Select("select * from t_goods where goodsId=#{goodsid}")
    TGoods selectOneGoodsById(Integer id);
}